package app;

public class StartupManager {
	
	private CLI cli = new CLI(); //Command Line Interpreter

	public static void main(String args[])
	{
		new StartupManager();
	}
	
	public StartupManager()
	{
		System.out.println("Welcome to the Foxtrot Plagiarism Detector");
		System.out.println();
		go();
	}
	
	public void go()
	{
		int action = cli.getInt("What would you like to do? 1- Add a document.    2- Start a search.");
		switch(action){
		case 1:
			//Add a document
			DocumentManager doc = new DocumentManager();
			boolean result = doc.addDocument();
			if(result)
				System.out.println("The document has been succesfully stored.");
			else
				System.out.println("There was an error while storing the document.");
			go();
		break;
		case 2:
			//Start a search
			new SearchManager();
			go();
		break;
		default:
			System.out.println("That was an invalid choice!");
			go();
		break;
		}
	}	
}
